#include "DialogMinMaxDist.h"
#include "MainFrame.h"
DialogMinMaxDist::DialogMinMaxDist( wxWindow* parent )
:
DialogMinMaxTemplate( parent )
{

}

void DialogMinMaxDist::OnNewValueMin( wxSpinEvent& event )
{
	MainFrame* parent = (MainFrame*)this->GetParent();
	
	parent->setMinDist(spinCtrlMin->GetValue());
}

void DialogMinMaxDist::OnNewValueMax( wxSpinEvent& event )
{
	MainFrame* parent = (MainFrame*)this->GetParent();
	
	parent->setMaxDist(spinCtrlMax->GetValue());
}

void DialogMinMaxDist::updateDists()
{
	MainFrame* parent = (MainFrame*)this->GetParent();
	
	int minDist = parent->getMinDist();
	int maxDist = parent->getMaxDist();
	
	spinCtrlMin->SetValue(minDist);
	spinCtrlMax->SetValue(maxDist);
	
	
}

void DialogMinMaxDist::setMaxVal(int dist)
{
	spinCtrlMax->SetValue(dist);
}
